﻿
//------------------------------------------------ 导航条按下----------------------------------------------------
$('a.scrollToBottom0').click(function(){ 
				$('html, body, .content').animate({scrollTop: $("body").offset().top}, 300);
				var content = document.getElementById('navbar-collapse-01');
        		var links = content.getElementsByTagName('a');
        		for (var i = 0; i < links.length; i++) {
					if(links[i]==links[0])
						links[i].className = "navFocus";
					else
                		links[i].className = "notFocus";
            		} 
				return false; 
			}); 
			$('a.scrollToBottom1').click(function(){ 
				$('html, body, .content').animate({scrollTop: $("#section2").offset().top}, 300); 
				var content = document.getElementById('navbar-collapse-01');
        		var links = content.getElementsByTagName('a');
        		for (var i = 0; i < links.length; i++) {
					if(links[i]==links[1])
						links[i].className = "navFocus";
					else
                		links[i].className = "notFocus";
            		} 				
				return false; 
			}); 
			$('a.scrollToBottom2').click(function(){ 
				$('html, body, .content').animate({scrollTop: $("#section3").offset().top}, 300); 
				var content = document.getElementById('navbar-collapse-01');
        		var links = content.getElementsByTagName('a');
        		for (var i = 0; i < links.length; i++) {
					if(links[i]==links[2])
						links[i].className = "navFocus";
					else
                		links[i].className = "notFocus";
            		} 
				return false; 
			}); 
			$('a.scrollToBottom3').click(function(){ 
				$('html, body, .content').animate({scrollTop: $("#section4").offset().top}, 300); 
				var content = document.getElementById('navbar-collapse-01');
        		var links = content.getElementsByTagName('a');
        		for (var i = 0; i < links.length; i++) {
					if(links[i]==links[3])
						links[i].className = "navFocus";
					else
                		links[i].className = "notFocus";
            		} 
				return false; 
			}); 
			$('a.scrollToBottom4').click(function(){ 
				$('html, body, .content').animate({scrollTop: $("#section5").offset().top}, 300); 
				var content = document.getElementById('navbar-collapse-01');
        		var links = content.getElementsByTagName('a');
        		for (var i = 0; i < links.length; i++) {
					if(links[i]==links[4])
						links[i].className = "navFocus";
					else
                		links[i].className = "notFocus";
            		} 
				return false; 
			}); 
			$('a.scrollToBottom5').click(function(){ 
				$('html, body, .content').animate({scrollTop: $("#section6").offset().top}, 300);
				var content = document.getElementById('navbar-collapse-01');
        		var links = content.getElementsByTagName('a');
        		for (var i = 0; i < links.length; i++) {
					if(links[i]==links[5])
						links[i].className = "navFocus";
					else
                		links[i].className = "notFocus";
            		}  
				return false; 
			}); 
			$('a.scrollToBottom6').click(function(){ 
				$('html, body, .content').animate({scrollTop: $("#section7").offset().top}, 300); 
				var content = document.getElementById('navbar-collapse-01');
        		var links = content.getElementsByTagName('a');
        		for (var i = 0; i < links.length; i++) {
					if(links[i]==links[6])
						links[i].className = "navFocus";
					else
                		links[i].className = "notFocus";
            		} 
				return false; 
			}); 
			$('#arrowTop').click(function(){ 
				$('html, body, .content').animate({scrollTop: $("body").offset().top}, 300); 
				var content = document.getElementById('navbar-collapse-01');
        		var links = content.getElementsByTagName('a');
        		for (var i = 0; i < links.length; i++) {
					if(links[i]==links[0])
						links[i].className = "navFocus";
					else
                		links[i].className = "notFocus";
            		} 
				return false; 
			}); 
			
//------------------------------------------------ 导航条滚动----------------------------------------------------

  var scrollFunc = function (e) {
        var direct = 0;
        e = e || window.event;
       if (e.detail) {  //Firefox滑轮事件
            if (e.detail> 0) { //当滑轮向上滚动时
                s = $(document).scrollTop();
	a = $("#section1").offset().top-200;
	b = $("#section2").offset().top-200;
	c = $("#section3").offset().top-200;
	d = $("#section4").offset().top-200;
	e = $("#section5").offset().top-200;
	f = $("#section6").offset().top-200;
	g = $("#section7").offset().top-200;
	if(s>=a&&s<b){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[0])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s>=b&&s<c){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[1])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s<d){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[2])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s<e){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[3])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s<f){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[4])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s<g){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[5])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else{
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[6])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
            }
            if (e.detail< 0) { //当滑轮向下滚动时
                                s = $(document).scrollTop();
	a = $("#section1").offset().top;
	b = $("#section2").offset().top-200;
	c = $("#section3").offset().top-500;
	d = $("#section4").offset().top-400;
	e = $("#section5").offset().top-400;
	f = $("#section6").offset().top-400;
	g = $("#section7").offset().top-400;
	if(s>=a&&s<b){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[0])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s<c){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[1])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s<d){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[2])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s<e){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[3])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s<f){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[4])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else if(s<g){
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[5])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
	else{
		var content = document.getElementById('navbar-collapse-01');
        var links = content.getElementsByTagName('a');
        for (var i = 0; i < links.length; i++) {
			if(links[i]==links[6])
				links[i].className = "navFocus";
			else
                links[i].className = "notFocus";
            }
	}
            }
        }
        ScrollText(direct);
    }
    //给页面绑定滑轮滚动事件
    if (document.addEventListener) {
        document.addEventListener('DOMMouseScroll', scrollFunc, false);
    }
    //滚动滑轮触发scrollFunc方法
    window.onmousewheel = document.onmousewheel = scrollFunc;  
			
//------------------------------------------------ 触发窗口 ----------------------------------------------------
$(function(){
		
  		$('.modaltrigger').leanModal({ top: 110, overlay: 0.45, closeButton: ".hidemodal" });
		
  		$('#modaltrigger2').leanModal2({ top: 110, overlay: 0.45, closeButton: ".hidemodal2" });
		
  		$('#modaltrigger4').leanModal4({ top: 110, overlay: 0.45, closeButton: ".hidemodal4" });
		
		$('#modaltrigger5').leanModal5({ top: 110, overlay: 0.45, closeButton: ".hidemodal5" });
		
		});
//------------------------------------------------ 会员登录 ----------------------------------------------------
$('#memberLog').click(function(){ 
	memberLogName = document.getElementById("memberLogName").value;
	memberLogKey = document.getElementById("memberLogKey").value;
	if(memberLogName == ""){
		$("#warnMemberName").show();
	}
	else if(isNaN(memberLogName)){
		$("#warnMemberNumber").show();
	}
	if(memberLogKey == ""){
		$("#warnMemberKey").show();
	}
	
	$.ajax({
	    url: "vIP_login.action", //对应action的路径
	    dataType: "text",	    
	    data: { name: memberLogName, passwd: memberLogKey },   //传给程英的商家id
	    type: "post",
	    success: function (msg) {
	    	//alert(data.vipId);
	        //var obj = JSON.parse(data);
	    	var obj=msg;
	        if (obj< 0)
	            $("#warnMemberKey").show();
	        else if (obj > 0&&memberLogName != "" && !isNaN(memberLogName) && memberLogKey != "")
	            location.href = "LoggedMember.html?id=" + obj;
	    	
	    }
	    
	});
});
$('#memberLogName').blur(function(){
    memberLogName = document.getElementById("memberLogName").value;
	if(!isNaN(memberLogName)){
		$("#warnMemberNumber").hide();
	}
	if(memberLogName!="" )   
		$("#warnMemberName").hide();
   	if(memberLogName=="" )   
		$("#warnMemberName").show();
	else if(isNaN(memberLogName)){
		$("#warnMemberNumber").show();
	}
});
$('#memberLogKey').blur(function(){
    memberLogKey = document.getElementById("memberLogKey").value;
	if(memberLogKey!="" )   
		$("#warnMemberKey").hide();
   	if(memberLogKey=="" )   
		$("#warnMemberKey").show();
});

//------------------------------------------------ 商家登录 ----------------------------------------------------
$('#merchantLog').click(function(){ 
	merchantLogName = document.getElementById("merchantLogName").value;
	merchantLogKey = document.getElementById("merchantLogKey").value;
	if(merchantLogName == ""){
		$("#warnMerchantName").show();
	}
	else if(isNaN(merchantLogName)){
		$("#warnMerchantNumber").show();
	}
	if(merchantLogKey == ""){
		$("#warnMerchantKey").show();
	}

        $.ajax({
	    url: "merchant_login.action", //对应action的路径
	    dataType: "text",	    
	    data: { name: merchantLogName ,passwd: merchantLogKey  },   //传给程英的商家id
	    type: "post",
	    success: function (msg) {
	    	//alert(data.vipId);
	        //var obj = JSON.parse(data);
	    	var obj=msg;
	        if (obj< 0)
	            $("#warnMerchantKey").show();
	        else if (obj > 0 && merchantLogName != "" && !isNaN(merchantLogName) && merchantLogKey != "")
	            location.href = "LoggedMerchant.html?id=" + obj;
	    	
	    }
	    
	});


});
$('#merchantLogName').blur(function(){
    merchantLogName = document.getElementById("merchantLogName").value;
	if(!isNaN(merchantLogName)){
		$("#warnMerchantNumber").hide();
	}
	if(merchantLogName!="" )   
		$("#warnMerchantName").hide();
   	if(merchantLogName=="" )   
		$("#warnMerchantName").show();
	else if(isNaN(merchantLogName)){
		$("#warnMerchantNumber").show();
	}
});
$('#merchantLogKey').blur(function(){
    merchantLogKey = document.getElementById("merchantLogKey").value;
	if(merchantLogKey!="" )   
		$("#warnMerchantKey").hide();
   	if(merchantLogKey=="" )   
		$("#warnMerchantKey").show();
});

//------------------------------------------------ 运营方登录 ----------------------------------------------------
$('#operatorLog').click(function(){ 
	operatorLogName = document.getElementById("operatorLogName").value;
	operatorLogKey = document.getElementById("operatorLogKey").value;
	if(operatorLogName == ""){
		$("#warnOperatorName").show();
	}
	if(operatorLogKey == ""){
		$("#warnOperatorKey").show();
	}


        $.ajax({
	    url: "manager_login.action", //对应action的路径
	    dataType: "text",	    
	    data: { name: operatorLogName  ,passwd: operatorLogKey   },   //传给程英的商家id
	    type: "post",
	    success: function (msg) {
	    	//alert(data.vipId);
	        //var obj = JSON.parse(data);
	    	var obj=msg;
	        if (obj< 0)
	            $("#warnOperatorKey").show();
	        else if (obj > 0 && operatorLogName != "" && operatorLogKey != "")
	            location.href = "LoggedOperator.html?id=" + obj;
	    	
	    }
	    
	});


});
$('#operatorLogName').blur(function(){
    operatorLogName = document.getElementById("operatorLogName").value;
	if(operatorLogName!="" )   
		$("#warnOperatorName").hide();
   	if(operatorLogName=="" )   
		$("#warnOperatorName").show();
});
$('#operatorLogKey').blur(function(){
    operatorLogKey = document.getElementById("operatorLogKey").value;
	if(operatorLogKey!="" )   
		$("#warnOperatorKey").hide();
   	if(operatorLogKey=="" )   
		$("#warnOperatorKey").show();
});

//------------------------------------------------ 鼠标停留效果 ----------------------------------------------------

$(".brand").mouseover(function(){
  			$(this).animate({left:'+=10px'});
		}); 
		$(".brand").mouseout(function(){
  			$(this).animate({left:'-=10px'});
		}); 
		
		$(".imgScale").mouseover(function(){
        	$(this).fadeTo("fast", "0.7");
		}); 
		$(".imgScale").mouseout(function(){
  			$(this).fadeTo("fast", "1");
		}); 
		$(".topImg").mouseover(function(){
        	$(this).animate({height: 'toggle', opacity: 'toggle'}, "slow");
		});  
        $("#heartRight").mouseover(function(){
			$(this).css("backgroundImage","url(css/img/heartRightOn.jpg)"); 
		}); 
		$("#heartRight").mouseout(function(){
			$(this).css("backgroundImage","url(css/img/heartRight.png)"); 
		}); 
        $("#code").mouseover(function(){
			$(this).css("backgroundImage","url(css/img/codeOn.jpg)"); 
			$(this).parent().find('#codeFloat').slideDown();
		}); 
		$("#code").mouseout(function(){
			$(this).css("backgroundImage","url(css/img/code.png)"); 
			$(this).parent().find('#codeFloat').hide();
		}); 
		$("#codeFloat").mouseover(function(){
			$(this).show();
		}); 
		$("#codeFloat").mouseout(function(){
			$(this).slideUp();
		}); 
		$("#arrowTop").mouseover(function(){
			$(this).css("backgroundImage","url(css/img/arrayTopOn.jpg)"); 
		}); 
		$("#arrowTop").mouseout(function(){
			$(this).css("backgroundImage","url(css/img/arrayTop.png)"); 
		}); 
$(".title").hover(function(){
		$(this).find("img").stop(true,true);
		var imgWid2 = 0;var imgHei2 = 0;//局部变量
		imgWid = $(this).find("img").width();
		imgHei = $(this).find("img").height();
		imgWid2 = imgWid * 1.1;
		imgHei2 = imgHei * 1.1;
		$(this).find("img").css({"z-index":2});
		$(this).find("img").animate({"width":imgWid2,"height":imgHei2,"margin-left":-2});
},function(){$(this).find("img").stop().animate({"width":imgWid,"height":imgHei,"margin-left":0});});

$(".ls").mouseover(function(){
  	$(this).css({"color":"#1abc9c"});
}); 
$(".ls").mouseout(function(){
  	$(this).css({"color":"#fff"});
}); 

$(".round").mouseover(function(){
  	$(this).addClass("roundBig");
}); 
$(".round").mouseout(function(){
  	$(this).removeClass("roundBig");
}); 
//------------------------------------------------ 商家入盟验证 ----------------------------------------------------
$('#enterpriseName').blur(function(){
	if($(this).val()=='')
		$('#amWarnMerName').show();
	if($(this).val()!='')
		$('#amWarnMerName').hide();
});
$('#concreteAddress').blur(function(){
	if($(this).val()=='')
		$('#amWarnMerAdress').show();
	if($(this).val()!='')
		$('#amWarnMerAdress').hide();
});
$('#enterpriseTel').blur(function(){
	if($(this).val()=='')
		$('#amWarnMerTel').show();
	else if(isNaN($(this).val()))
		$('#amWarnMerTelNum').show();
	if($(this).val()!='')
		$('#amWarnMerTel').hide();
	if(!isNaN($(this).val()))
		$('#amWarnMerTelNum').hide();
});
$('#percentage').blur(function(){
	if($(this).val()=='')
		$('#amWarnPercentage').show();
	else if(!($(this).val()>=0&&$(this).val()<=100))
		$('#amWarnPerNum').show();
	if($(this).val()!='')
		$('#amWarnPercentage').hide();
	if($(this).val()>=0&&$(this).val()<=100)
		$('#amWarnPerNum').hide();
});
$('#contactName').blur(function(){
	if($(this).val()=='')
		$('#amWarnConName').show();
	if($(this).val()!='')
		$('#amWarnConName').hide();
});
$('#contactJob').blur(function(){
	if($(this).val()=='')
		$('#amWarnConJob').show();
	if($(this).val()!='')
		$('#amWarnConJob').hide();
});
$('#contactTel').blur(function(){
	if($(this).val()=='')
		$('#amWarnConTel').show();
	else if(isNaN($(this).val()))
		$('#amWarnConTelNum').show();
	if($(this).val()!='')
		$('#amWarnConTel').hide();
	if(!isNaN($(this).val()))
		$('#amWarnConTelNum').hide();
});
$('#verifyCode').blur(function(){
	if($(this).val()=='')
		$('#amWarnCode').show();
	if($(this).val()!='')
		$('#amWarnCode').hide();
});

$('#amButton').click(
function ()  
     {   
	 	var enterpriseName = document.getElementById("enterpriseName").value;
		var concreteAddress = document.getElementById("concreteAddress").value;
		var enterpriseTel = document.getElementById("enterpriseTel").value;
		var percentage = document.getElementById("percentage").value;
		var contactName = document.getElementById("contactName").value;
		var contactJob = document.getElementById("contactJob").value;
		var contactTel = document.getElementById("contactTel").value;
		var inputCode = document.getElementById("verifyCode").value;   
		var checkCode = document.getElementById("checkCode").value; 
		if(enterpriseName=="" )   
          $("#AddMerWarn").text("请输入企业名称");   
	   else if(concreteAddress=="" )    
          $("#AddMerWarn").text("请输入地址"); 
	   else if(enterpriseTel=="" )     
          $("#AddMerWarn").text("请输入企业电话"); 
	   else if(isNaN(enterpriseTel))     
          $("#AddMerWarn").text("企业电话应为数字串");  
	   else if(percentage=="" )     
          $("#AddMerWarn").text("请输入消费积分比例"); 
	   else if(!(percentage<=100&&percentage>=0))     
          $("#AddMerWarn").text("消费积分比例应为0%~100%"); 
	   else if(contactName=="" )   
          $("#AddMerWarn").text("请输入联系人姓名"); 
	   else if(contactJob=="" )   
          $("#AddMerWarn").text("请输入联系人职务");             
		else if(contactTel=="" )   
          $("#AddMerWarn").text("请输入联系人电话"); 
	    else if(isNaN(contactTel))     
          $("#AddMerWarn").text("联系人电话应为数字串");  
       else if(inputCode =="")   
       {   
           $("#AddMerWarn").text("请输入验证码");
       }   
       else if(inputCode != checkCode )   
       {   
          $("#AddMerWarn").text("验证码输入错误");  
          createCode();
       }   
     else
 		 {
         $("#AddMerWarn").html("<div align='center' id='amSuccess'><p>填写成功，请等待申请结果</p><p style='color:black;'>更换密码成功！</p><p style='color:black;' ><span id='secondCurrent' style='color:#F66;'></span>秒后自动跳转到<a href='home.html'><span style='color:#F66;'>首页</span></a></p></div>"); 
 		 grayMidWhite();
 		 jumpAuto();
		 }
       }   );

//------------------------------------------------ 忘记密码验证 ----------------------------------------------------
$('#inputName').blur(function(){ 
		if($("#inputName").val()!="")  
		    $("#fkWarnName").hide();
   		if($("#inputName").val()=="") {  
			$("#fkWarnName").html("请输入会员账号");
			$("#fkWarnName").show();}
		else if(isNaN($("#inputName").val())){  
			$("#fkWarnName").html("会员账号为手机号");
			$("#fkWarnName").show();}			
	});
	$('#verifyCode').blur(function(){
   		if($("#verifyCode").val()=="")   
			$("#fkWarnVerifyNull").show();
		if($("#verifyCode").val()!="")   
		    $("#fkWarnVerifyNull").hide();
	});

	$("#fkButton").click( function ()   
     {   
	 	if($("#inputName").val()=="")  {  
			$("#fkWarnName").html("请输入会员账号");
			$("#fkWarnName").show();}
		else if(isNaN($("#inputName").val())) {  
			$("#fkWarnName").html("会员账号为手机号");
			$("#fkWarnName").show();}
 		if($("#verifyCode").val()=="")   
			$("#fkWarnVerifyNull").show();
		else if($("#verifyCode").val()!=$("#checkCode").val()) 
			$("#fkWarnVerifyWrong").show(); 
 		if ($("#inputName").val() != "" && $("#verifyCode").val() != "" && $("#verifyCode").val() == $("#checkCode").val())
 		{
 		    var zhanghao = document.getElementById("inputName").value;
 		    location.href = "forgetKey2.html?id=" + zhanghao;

 		}
       } );
	   
	   
//------------------------------------------------ 忘记密码2验证 ----------------------------------------------------
	var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/; 
	$('#fk2InputName').blur(function(){
   		if($(this).val()=="" ){
			$("#fk2WarnName").html("请输入邮箱");
			$("#fk2WarnName").show();}
		else if(!reg.test($(this).val())){
			$("#fk2WarnName").html("邮箱格式错误");
			$("#fk2WarnName").show();}
		else  
		    $("#fk2WarnName").hide();
	});
	$('#fk2VerifyCode').blur(function(){
   		if($(this).val()=="" )   
			$("#fk2WarnVerifyNull").show();
		if($(this).val()!="" )   
		    $("#fk2WarnVerifyNull").hide();
	});
	$('#fk2Button').click(function() 
     {   
	 	var a = $('#fk2InputName').val()=="";
		var aa = !reg.test($('#fk2InputName').val());
		var b = $('#fk2VerifyCode').val()=="";
	 	if( a )   
			$("#fk2WarnName").show();
		else if(aa){
			$("#fk2WarnName").html("邮箱格式错误");
			$("#fk2WarnName").show();}
 		if( b )   
 		    $("#fk2WarnVerifyNull").show();
 		


	    //zlz:试一下
		var urlinfo = window.location.href; //获取当前页面的url 
		var len = urlinfo.length;//获取url的长度 
		var offset = urlinfo.indexOf("?");//设置参数字符串开始的位置 
		var newsidinfo = urlinfo.substr(offset, len)//取出参数字符串 这里会获得类似“id=1”这样的字符串 
		var newsids = newsidinfo.split("=");//对获得的参数字符串按照“=”进行分割 
		var member_Id = newsids[1];
		var yanzheng = document.getElementById("fk2VerifyCode");

		if (!a && !b && !aa)
		    location.href = "forgetKey3.html?name=" + member_Id;


		//$.ajax({
		//    url: "vIP_validCode.action", //对应action的路径
		//    dataType: "text",
		//    data: { name: member_Id, validCode: yanzheng },   //传给程英的商家id
		//    type: "get",
		//    success: function (data) {

		//        if (data == "success" && !a && !b && !aa) {
		//            location.href = "forgetKey3.html?name=" + member_Id;
		//        }
		//        else
		//        {
		//            $("#fk2WarnName").html("验证失败");
		//            $("#fk2WarnName").show();
		//        }
		//    }

		//});


	});

//------------------------------------------------ 发送邮箱 ----------------------------------------------------
	

  $('#getCode').click(
	function () {
			var InterValObj; //timer变量，控制时间
	var count = 60; //间隔函数，1秒执行
	var curCount;//当前剩余秒数
	curCount = count;
	//设置button效果，开始计时
     $("#getCode").attr("disabled", "true");
	 $("#getCode").html("请在" + curCount + "秒后再获取验证码");
     InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次

	function SetRemainTime() {
            if (curCount == 0) {                
                window.clearInterval(InterValObj);//停止计时器
                $("#getCode").removeAttr("disabled");//启用按钮
                $("#getCode").html("重新发送验证码");
            }
            else {
                curCount--;
                $("#getCode").html("请在" + curCount + "秒后再获取验证码");
            }
	}
 

	//    //zlz:试一下
	//var urlinfo = window.location.href; //获取当前页面的url 
	//var len = urlinfo.length;//获取url的长度 
	//var offset = urlinfo.indexOf("?");//设置参数字符串开始的位置 
	//var newsidinfo = urlinfo.substr(offset, len)//取出参数字符串 这里会获得类似“id=1”这样的字符串 
	//var newsids = newsidinfo.split("=");//对获得的参数字符串按照“=”进行分割 
	//var member_Id = newsids[1];
	//var email=document.getElementById("fk2InputName");


	//$.ajax({
	//    url: "vIP_resetPasswd.action", //对应action的路径
	//    dataType: "text",
	//    data: { name: member_Id,mail:email},   //传给程英的商家id
	//    type: "GET",
	//    success: function (msg) {

	//        if(msg=="error")
	//        {
	//            $("#fk2WarnName").html("邮箱验证失败");
	//            $("#fk2WarnName").show();
	//            email.textContent="";
	//        }
	//    }

	//});
	});

//------------------------------------------------ 忘记密码3验证 ----------------------------------------------------

	$('#keyNew').blur(function(){
   		if($(this).val()=="" )   
			$("#fk3WarnName").show();
		if($(this).val()!="" )   
		    $("#fk3WarnName").hide();
	});
	$('#keySure').blur(function(){
   		if($(this).val()=="" )   
			$("#fk3WarnVerifyNull").show();
		if($(this).val()!="" )   
		    $("#fk3WarnVerifyNull").hide();
	});
	$('#fk3Button').click(
	 function ()   
     {   
	 	var a = $('#keyNew').val()=="" ;
		var b = $('#keySure').val()=="" ;
		var c = $('#keyNew').val()!=$('#keySure').val();
	 	if(a)   
			$("#fk3WarnName").show();
 		if(b)   
			$("#fk3WarnVerifyNull").show();
		else if (c)
			$("#fk3WarnVerifyWrong").show();
 		if (!a && !b && !c)
 		{
 		    ////zlz:试一下
 		    //var urlinfo = window.location.href; //获取当前页面的url 
 		    //var len = urlinfo.length;//获取url的长度 
 		    //var offset = urlinfo.indexOf("?");//设置参数字符串开始的位置 
 		    //var newsidinfo = urlinfo.substr(offset, len)//取出参数字符串 这里会获得类似“id=1”这样的字符串 
 		    //var newsids = newsidinfo.split("=");//对获得的参数字符串按照“=”进行分割 
 		    //var member_Id = newsids[1];
 		    //var key = document.getElementById("keyNew");


 		    location.href = "forgetKey4.html";

 		    //$.ajax({
 		    //    url: "vIP_setNewPasswd.action", //对应action的路径
 		    //    dataType: "text",
 		    //    cache: false,
 		    //    data: { name: member_Id, newPasswd: key },   //传给程英的商家id
 		    //    type: "POST",
 		    //    success: function (data) {

 		    //        if (data == "error") {
 		    //            $("#fk3WarnVerifyWrong").html("重置失败，请重试");
 		    //            $("#fk3WarnVerifyWrong").show();
 		    //        }
 		    //        else
 		    //            location.href = "forgetKey4.html";
 		    //    }

 		    //});
 		}

	    

       }   );


//------------------------------------------------ 分领域展示 ----------------------------------------------------

		$(".scShowLeft").mouseover(function(){
			$(this).find('a').show();
		}); 
		$(".scShowLeft").mouseout(function(){
			$(this).find('a').hide();
		}); 
		$(".scBrandSmall").mouseover(function(){
  			$(this).animate({left:'+=10px'});
		}); 
		$(".scBrandSmall").mouseout(function(){
  			$(this).animate({left:'-=10px'});
		}); 

//------------------------------------------------ 商家展示 ----------------------------------------------------

		$("#showConcreteButton").mouseover(function(){
			$(this).parent().find('#showConcrete').show();
		}); 
		$("#showConcreteButton").mouseout(function(){
			$(this).parent().find('#showConcrete').hide();
		}); 
		$("#showConcrete").mouseover(function(){
			$(this).show();
		}); 
		$("#showConcrete").mouseout(function(){
			$(this).hide();
		}); 
		
	$('.showProduct').mouseover(
		function (){
			$(this).removeClass().addClass("showProductShadow");
	});
		
	$('.showProduct').mouseout(	
		function shadowOut(shadowOutMe){
			$(this).removeClass().addClass("showProduct");
	});

	var countHeart=0;
	$(".showHeart").mouseover(function(){
		$(this).attr("src","css/img/showHeart.png");        
		}); 
	$(".showHeart").mouseout(function(){
		if(countHeart==0){
			$(this).attr("src","css/img/showHeartNone.png");  
		}
		}); 
	$(".showHeart").click(function(){
		if(countHeart==0){
			$(this).attr("src","css/img/showHeart.png");   
			countHeart=1;
		}
		else{
			$(this).attr("src","css/img/showHeartNone.png");   
			countHeart=0;
		}  
	}); 


//------------------------------------------------ 产品展示 ----------------------------------------------------

		var countHeart=0;
	$("#spshowHeart").mouseover(function(){
		$(this).attr("src","css/img/showHeart.png");        
		}); 
	$("#spshowHeart").mouseout(function(){
		if(countHeart==0){
			$(this).attr("src","css/img/showHeartNone.png");  
		}
		}); 
	$("#spshowHeart").click(function(){
		if(countHeart==0){
			$(this).attr("src","css/img/showHeart.png");   
			countHeart=1;
		}
		else{
			$(this).attr("src","css/img/showHeartNone.png");   
			countHeart=0;
		}  
	}); 
	
	
	$("#spBrandSmall").mouseover(function(){
  		$(this).animate({left:'+=10px'});
	}); 
	$("#spBrandSmall").mouseout(function(){
  		$(this).animate({left:'-=10px'});
	}); 



//------------------------------------------------ 自动回到首页 ----------------------------------------------------


	function jumpAuto(){
		var InterValObj; //timer变量，控制时间
	var count = 5; //间隔函数，1秒执行
	var curCount;//当前剩余秒数
		curCount = count;
		$("#secondCurrent").html(curCount);
		InterValObj = window.setInterval(SetRemainTime, 1000);
		function SetRemainTime() {
            if (curCount == 0) {                
                window.clearInterval(InterValObj);//停止计时器
				location.href = "home.html";
            }
            else {
                curCount--;
                $("#secondCurrent").html(curCount);
            }
        }
	}
	
//------------------------------------------------ 幻灯片 ----------------------------------------------------

var carousel_taskId;
        (function(){
            jQuery('#user_name').hover(function(){
                jQuery('#name_menu').show();
	        });
	        jQuery('#name_menu').mouseleave(function(){
	            jQuery('#name_menu').hide();
	        });
        
            getCmtNum();
            showPvNum(165019088 + 150000000);
            showGarbageNum(1943050);
            setInterval(getCmtNum,3000);
            bindCarousel();
            carousel_taskId = setTimeout(carouselNext,4000);
        })(jQuery)
		
//------------------------------------------------ 选择城市 ----------------------------------------------------

function changeCity(myself){
        var content = document.getElementById('city');
		var present = document.getElementById('presentCity');
		var txt = $(myself).text();
        $(present).text(txt);
	}

//------------------------------------------------ 选择下拉框 ----------------------------------------------------

function changeStyle(myself){
		
        var content = $(myself).parent().parent();
		var present =$(content).parent().find('.presentStyle');
		var txt = $(myself).text();
        $(present).text(txt);
	}	

//------------------------------------------------ 创建验证码 ----------------------------------------------------

var code ; //在全局 定义验证码   
     function createCode()   
     {    
       code = "";   
       var codeLength = 4;//验证码的长度   
       var checkCode = document.getElementById("checkCode");   
       var selectChar = new Array(0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');//所有候选组成验证码的字符，当然也可以用中文的   
           
       for(var i=0;i<codeLength;i++)   
       {   
         
           
       var charIndex = Math.floor(Math.random()*36);   
       code +=selectChar[charIndex];   
          
          
       }   
//       alert(code);   
       if(checkCode)   
       {   
         checkCode.className="code";   
         checkCode.value = code;   
       }   
          
     }   
//------------------------------------------------ 调用地图 ----------------------------------------------------
	function showMap(){
		var map1 = new BMap.Map("showMap1");
		map1.centerAndZoom(new BMap.Point(121.491, 31.233), 11);
		var ctrl_nav1 = new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE });         var ctrl_nav2 = new BMap.NavigationControl({ anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_LARGE });             
   		map1.addControl(ctrl_nav1); 
		var map2 = new BMap.Map("showMap2");
		map2.centerAndZoom(new BMap.Point(121.491, 31.233), 11);
		map2.addControl(ctrl_nav2); 
	}
	 
